/**
 ----------------------
 1.当前文件用于编辑表单
 2.提供表单相关属性
 3. @param xxxFormConfig.current 指向当前选中的数据
 ----------------------
 */
import type {AxComment} from '@/api/modules/ax/comment/types';
import type {Rule} from 'ant-design-vue/es/form/interface';
import {useAxForm} from '@/utils/common/hooks';

const commentFormObj: AxComment = {
        id: 0 ,
        author: "" ,
        content: "" ,
        createTime: null ,
        avatar: "" ,
        updateTime: null ,
        love: "" ,
        flag: "" ,
        parentId: 0 ,
        userId: 0 ,
};

// 表格校验
export const commentRules: Record<string, Rule[]> = {
    author: [{required: false , trigger: 'change'}],
    content: [{required: false , trigger: 'change'}],
    avatar: [{required: false , trigger: 'change'}],
    love: [{required: false , trigger: 'change'}],
    flag: [{required: false , trigger: 'change'}],
};
export const commentFormConfig = useAxForm<AxComment>(commentFormObj);
export const commentFormRef = ref()
